<!DOCTYPE html>
<html lang="en">
<head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <title>Anmol Cards - Client Login</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="author" content="WebsiteApps, Digvijay Mohite">


    <link href="<?php assetH("css/bootstrap.css") ?>" rel="stylesheet">
    <link href="<?php assetH("style.css") ?>" rel="stylesheet">
    <link href="<?php assetH("css/flexslider.css") ?>" rel="stylesheet">
    <link href="<?php assetH("css/owl-carousel.css") ?>" rel="stylesheet">
    <link href="<?php assetH("css/animate.min.css") ?>" rel="stylesheet">

    <!-- Google Fonts -->
    <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic' rel='stylesheet'
          type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Lato:400,300,400italic,300italic,700,700italic,900'
          rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Exo:400,300,600,500,400italic,700italic,800,900' rel='stylesheet'
          type='text/css'>

    <!--[if lt IE 9]>
    <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Enable media queries on older bgeneral_rowsers -->
    <!--[if lt IE 9]>
    <script src="<?php assetH(" js/respond.min.js")?>"></script>
    <![endif]-->

    <link href="<?php asset("dist/ladda-themeless.min.css") ?>" rel="stylesheet" type='text/css'>
</head>
<body>

<div class="animationload">
    <div class="loader">Loading...</div>
</div>


<div id="topbar" class="clearfix">
    <div class="container">
        <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
            <div class="social-icons">
                <span><a data-toggle="tooltip" data-placement="bottom" title="Facebook" href="#"><i
                            class="fa fa-facebook"></i></a></span>
                <span><a data-toggle="tooltip" data-placement="bottom" title="Google Plus" href="#"><i
                            class="fa fa-google-plus"></i></a></span>
                <span><a data-toggle="tooltip" data-placement="bottom" title="Twitter" href="#"><i
                            class="fa fa-twitter"></i></a></span>
                <span><a data-toggle="tooltip" data-placement="bottom" title="Youtube" href="#"><i
                            class="fa fa-youtube"></i></a></span>
                <span><a data-toggle="tooltip" data-placement="bottom" title="Linkedin" href="#"><i
                            class="fa fa-linkedin"></i></a></span>
                <span><a data-toggle="tooltip" data-placement="bottom" title="Dribbble" href="#"><i
                            class="fa fa-dribbble"></i></a></span>
                <span class="last"><a data-toggle="tooltip" data-placement="bottom" title="Skype" href="#"><i
                            class="fa fa-skype"></i></a></span>
            </div>
            <!-- end social icons -->
        </div>
        <!-- end columns -->
        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
            <div class="topmenu">
                <span class="topbar-login"><i class="fa fa-user"></i><a id="logged-in-user"
                                                                        href="<?php nav_url("client/login") ?>"> <?php if ($user != null) {
                            echo $user;
                        } else {
                            echo "Login / Register";
                        } ?></a></span>
                <span class="topbar-cart"><i class="fa fa-shopping-cart"></i> <a
                        class="header-cart-popup"><?php echo $cart['noOfItems'] ?> item - <i class="fa fa-rupee"></i>
                        &nbsp;<?php echo $cart['totalRupees'] ?></a></span>
            </div>
            <!-- end top menu -->
        </div>
        <!-- end columns -->
    </div>
    <!-- end container -->
</div>
<!-- end topbar -->

<header id="header-style-1">
    <div class="container">
        <nav class="navbar yamm navbar-default">
            <div class="navbar-header">
                <button type="button" data-toggle="collapse" data-target="#navbar-collapse-1" class="navbar-toggle">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="index.html" class="navbar-brand"></a>
            </div>
            <!-- end navbar-header -->

            <div id="navbar-collapse-1" class="navbar-collapse collapse navbar-right">
                <ul class="nav navbar-nav">
                    <li><a href="<?php echo base_url() ?>">Home</a></li>
                    <li><a href="<?php nav_url("about"); ?>">About</a></li>
                    <li class="dropdown yamm-fw"><a href="#" data-toggle="dropdown" class="dropdown-toggle">Product
                            Gallery
                            <div class="arrow-up"></div>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <div class="yamm-content">
                                    <div class="row">
                                        <?php
                                        foreach ($categories as $category) {
                                            if ($category->getParent() == null && $category->getNoOfSub() > 0) {
                                                echo "<ul class='col-sm-3'>";
                                                echo "<li><h3>" . $category->getName() . "</h3></li>";
                                                foreach ($categories as $sub) {
                                                    if ($sub->getParent() != null && $sub->getParent()->getId() == $category->getId()) {
                                                        echo "<li><a href='" . nav_url_spl("gallery/item/" . $sub->getId()) . "'>" . $sub->getName() . "</a></li>";
                                                    }
                                                }
                                                echo "</ul>";
                                            }
                                        }
                                        ?>
                                    </div>
                                    <!-- end row -->
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li><a href="<?php nav_url("contact"); ?>">Contact</a></li>
                </ul>
                <!-- end navbar-nav -->
            </div>
            <!-- #navbar-collapse-1 -->
        </nav>
        <!-- end navbar yamm navbar-default -->
    </div>
    <!-- end container -->
</header>
<!-- end header-style-1 -->

<section class="post-wrapper-top jt-shadow clearfix">
    <div class="container">
        <div class="col-lg-12">
            <h2>Login & Register</h2>
            <ul class="breadcrumb pull-right">
                <li><a href="index.html">Home</a></li>
                <li>Login & Register</li>
            </ul>
        </div>
    </div>
</section>
<!-- end post-wrapper-top -->

<section class="blog-wrapper">
    <div class="container">
        <div id="content" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="row">
                <div class="col-md-6">
                    <div class="widget">
                        <div class="title">
                            <h3>Login Your Account</h3>
                        </div>
                        <!-- end title -->
                        <form id="loginform" method="post" name="loginform">
                            <div class="form-group">
                                <div id="username-label" class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    <input id="username" name="username" type="email" class="form-control"
                                           placeholder="Email">
                                </div>
                            </div>
                            <div class="form-group">
                                <div id="password-label" class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                                    <input id="password" name="password" type="password" class="form-control"
                                           placeholder="Password">
                                </div>
                            </div>
                            <div class="form-group">
                                <button id="login-submit-btn" type="button" class="btn btn-primary">Sign in</button>
                                <a id="forgot-password-link" style="margin-left:5%;cursor:pointer">Forgot Password</a>
                            </div>
                        </form>
                        <div id="login-error" class='alert alert-danger' style="display: none"></div>
                        <div id="forget-success" class='alert alert-success' style="display: none"></div>
                    </div>
                    <!-- end widget -->
                </div>
                <!-- end col-md-6 -->
                <div class="col-md-6">
                    <div class="widget">
                        <div class="title">
                            <h3>Create An Account</h3>
                        </div>
                        <!-- end title -->
                        <form id="registerform">
                            <div class="form-group">
                                <input type="text" class="form-control" id="business-name" name="business-name"
                                       placeholder="Agency/Business name" data-validation="required"
                                       data-validation-error-msg="Please enter Agency / Business name.">
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="first-name" name="first-name"
                                       placeholder="First name" data-validation="required"
                                       data-validation-error-msg="Please enter your first name.">
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="last-name" name="last-name"
                                       placeholder="Last name" data-validation="required"
                                       data-validation-error-msg="Please enter your last name.">
                            </div>
                            <div class="form-group">
                                <input type="email" class="form-control" id="email" name="email" placeholder="Email"
                                       data-validation="email"
                                       data-validation-error-msg="Please enter valid email">
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="phone" name="phone" placeholder="Phone"
                                       data-validation="number"
                                       data-validation-error-msg="Please enter valid phone number">
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-control" id="r-password" name="r-password"
                                       placeholder="Password" data-validation="required"
                                       data-validation-error-msg="Please enter password.">
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="re-password" name="re-password"
                                       placeholder="Re-enter password" data-validation="required"
                                       data-validation-error-msg="Please enter password.">
                            </div>
                            <div class="form-group">
                                <button id="submit-register-account-btn" type="submit"
                                        class="btn btn-primary ladda-button" data-style="slide-right">
                                    Register an account
                                </button>
                            </div>
                        </form>
                    </div>
                    <div id="register-response">
                        <div class='alert alert-success' style="display: none">
                        </div>
                        <div class='alert alert-danger' style="display: none">
                        </div>
                    </div>
                    <!-- end widget -->
                </div>
                <!-- end col-md-6 -->
            </div>
            <!-- end row -->
        </div>
        <!-- end content -->
    </div>
    <!-- end container -->
</section>
<!--end white-wrapper -->

<footer id="footer-style-1">
    <div class="container">
        <div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
            <div class="widget">
                <img class="padding-top" src="<?php assetH("images/logo.png") ?>" alt="">
                <p>Wedding is the most important & auspicious occasion of any ones life.It is not only occasion of two souls but weaving together of two families & their culture.
                    Anmol cards is the leading stockist of all types of wedding cards having three decades of experience is situated in the heart of  MIRAJ, SANGLI & KOLHAPUR  City.</p>
                <!-- end social icons -->
            </div>
            <!-- end widget -->
        </div>
        <!-- end columns -->

        <!-- end columns -->
        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
            <div class="widget">
                <div class="title">
                    <h3>NewsLetter</h3>
                </div>
                <!-- end title -->
                <div class="newsletter_widget">
                    <p>Subscribe to our newsletter to receive news, updates, free stuff and new releases by email. We
                        don't do spam..</p>

                    <form action="#" class="newsletter_form">
                        <input type="text" id="subscribe-email" class="form-control" placeholder="Enter your email address">
                        <a href="#" class="btn btn-primary pull-right subscribe">Subscribe</a>
                    </form>
                    <!-- end newsletter form -->
                </div>
            </div>
            <!-- end widget -->
        </div>
        <!-- end columns -->
    </div>
    <!-- end container -->
</footer>

<!-- end #footer-style-1 -->

<div id="copyrights">
    <div class="container">
        <div class="col-lg-5 col-md-6 col-sm-12">
            <div class="copyright-text">
                <p>Copyright © <?php date_default_timezone_set("Asia/Calcutta");
                    echo date('Y'); ?> - Powered by <a href="http://www.websiteapps.in/">WebsiteApps</a> & <a
                        href="http://www.avisgraphics.co.in/"> Avis Graphics</a></p>
            </div>
            <!-- end copyright-text -->
        </div>
        <!-- end widget -->
        <div class="col-lg-7 col-md-6 col-sm-12 clearfix">
            <div class="footer-menu">
                <ul class="menu">
                    <li class="active"><a class="header-cart-popup" href="#">Terms & Conditions</a></li>
                    <li><a href="<?php nav_url("about"); ?>">About us</a></li>
                    <li><a href="<?php nav_url("contact"); ?>">Contact</a></li>
                </ul>
            </div>
        </div>
        <!-- end large-7 -->
    </div>
    <!-- end container -->
</div>
<!-- end copyrights -->

<div class="dmtop">Scroll to Top</div>

<!-- Main Scripts-->
<script src="<?php assetH("js/jquery.js") ?>"></script>
<script src="<?php assetH("js/bootstrap.min.js") ?>"></script>
<script src="<?php assetH("js/menu.js") ?>"></script>
<script src="<?php asset("validator/jquery.form-validator.min.js") ?>"></script>
<script src="<?php assetH("js/owl.carousel.min.js") ?>"></script>
<script src="<?php assetH("js/jquery.parallax-1.1.3.js") ?>"></script>
<script src="<?php assetH("js/jquery.simple-text-rotator.js") ?>"></script>
<script src="<?php assetH("js/wow.min.js") ?>"></script>
<script src="<?php assetH("js/jquery.fitvids.js") ?>"></script>
<script src="<?php assetH("js/custom.js") ?>"></script>
<script src="<?php assetH("js/jquery.isotope.min.js") ?>"></script>
<script src="<?php assetH("js/custom-portfolio.js") ?>"></script>
<script src="<?php assetH("js/jquery.flexslider.js") ?>"></script>
<script src="<?php asset("js/jquery.form.js") ?>" type="text/javascript"></script>
<script src="<?php asset("dist/spin.min.js") ?>"></script>
<script src="<?php asset("dist/ladda.min.js") ?>"></script>
<script src="<?php assetH("js/cart.js") ?>"></script>
<script type="text/javascript">
    (function ($) {
        "use strict";
        $(window).load(function () {
            $('.flexslider').flexslider({
                animation: "fade",
                controlNav: false,
                start: function (slider) {
                    $('body').removeClass('loading');
                }
            });
        });
    })(jQuery);
</script>
<script>
    $.validate({
        form: '#registerform',
        validateOnBlur: false,
        onError: function () {
            return false;
        },
        onSuccess: function ($form) {
            var btn = Ladda.create(document.querySelector("#submit-register-account-btn"));
            btn.start();
            if ($("#r-password").val() == $("#re-password").val()) {
                $.post("<?php nav_url("client/register") ?>", $form.serialize(),function (response) {
                    if (!response.error) {
                        $("#register-response").find(".alert-success").css("display", "block").html(response.data);
                        $form.resetForm();
                    } else {
                        $("#register-response").find(".alert-danger").css("display", "block").html(response.errorMessage);
                    }
                }).always(function () {
                        btn.stop();
                    });
            } else {
                alert("TODO : Password Do not match.");
            }
            return false;
        }
    });

    $("#login-submit-btn").click(function () {
        var isValid = true;
        if ($("#username").val() == "") {
            $("#username-label").addClass("has-error");
            isValid = false;
        } else {
            $("#username-label").removeClass("has-error");
        }
        if ($("#password").val() == "") {
            $("#password-label").addClass("has-error");
            isValid = false;
        } else {
            $("#password-label").removeClass("has-error");
        }
        if (isValid) {
            $.post("<?php nav_url("client/signin")?>", $("#loginform").serialize(), function (response) {
                if (!response.error) {
                    location.reload(true);
                } else {
                    $("#login-error").show();
                    $("#login-error").text(response.errorMessage);
                }
            });
        }
    });

    $("#forgot-password-link").click(function(){
        $("#login-error").hide();
        $("#username-label").removeClass("has-error");
        var isValid = true;
        if ($("#username").val() == "") {
            $("#username-label").addClass("has-error");
            isValid = false;
        }
        if(isValid){
            $.post("<?php nav_url("client/forgotPassword")?>","email="+ $("#username").val(),function(response){
                if(!response.error){
                    $("#forget-success").show();
                    $("#forget-success").text("Email with password has been sent. Please check you email.");
                }else{
                    $("#login-error").show();
                    $("#login-error").text(response.errorMessage);
                }
            });
        }else{
            $("#login-error").show();
            $("#login-error").text("Please enter valid email.");
        }
    });

</script>
<?php include('cartpopup.php') ?>
<?php include("cartjs.php") ?>
</body>
</html>